package cn.itcast.scala

object MapTest {
	def main(args: Array[String]): Unit = {
		val colors = Map("red" -> "#FF0000","azure" -> "#F0FFFF","peru" -> "#CD853F")
		val peruColors = if (colors.contains("peru")) colors("peru") else 0
		val azureColor = colors.getOrElse("azure",0)

		println("获取 colors中键为red的值:" + colors("red"))
		println("获取 colors中所有的键:" + colors.keys)
		println("获取 colors中所有的值:" + colors.values)
		println("监测 colors是否为空:" + colors.isEmpty)
		println("判断 colors是否包含建peru:" + peruColors)
		println("判断 colors是否包含建azure:" + azureColor)
	}
}
